package cn.bitkit.tools.data;

import java.util.regex.Pattern;

public class NameUtil {

    public static final Pattern CHINESE_NAME = Pattern.compile("^[一-龥]{2,20}(·[一-龥]{2,20})*$");

    public static boolean checkName(String name){
        //name
        if(name == null || name.length() < 2 || name.length() > 20){
            return false;
        }
        //必须是汉字（少数民族可以有点）
        return CHINESE_NAME.matcher(name).matches();
    }

}
